include_directories(${Python_INCLUDE_DIRS} ${TORCH_INCLUDE_DIRS}) 
link_libraries(${TORCH_LIBRARIES})
add_compile_options(-fPIC)

add_subdirectory(ops)

# AgradTest
add_library(AgradTest SHARED grad.cpp helpers.cu GraphInterface.cu gnn_test.cu)
target_link_libraries(AgradTest PRIVATE GraphLib OpLib)
set_target_properties(AgradTest PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

if(THD)
target_compile_definitions(TorchExt PRIVATE THD=${THD})
message(THD=${THD})
endif()

if(BSZ)
target_compile_definitions(TorchExt PRIVATE BSZ=${BSZ})
message("BSZ=(${BSZ}*THD)")
endif()

if(H_TRESH)
target_compile_definitions(TorchExt PRIVATE H_TRESH=${H_TRESH})
message("-DH_TRESH=(${H_TRESH}*THD)")
endif()
